import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators'
export interface IUserState {
  token: string
}

@Module
export default class User extends VuexModule implements IUserState {
  token = ''

  get getToken() {
    return this.token
  }
  @Mutation
  SET_TOKEN(value: string) {
    this.token = value
  }

  @Action
  ResetToken() {
    this.token = ''
  }
}

export const UserModule = getModule(User)
